fix: tolerant version comparison#253
Open
Sam Gammon (sgammon) wants to merge 4 commits into
Open
Conversation
Compare versions by normalized core, ignoring a leading `v` and semver build metadata, so a release tag like `1.2.0+20260430` (or `v1.2.0`) matches a binary that self-reports `1.2.0` instead of emitting a spurious "version mismatch" warning. A genuine version difference still warns. Applies to both the post-download check and the existing-binary preserve check. Rebuilds the dist bundle. Signed-off-by: Sam Gammon <sam@elide.dev>
`version: latest` resolves whatever release GitHub marks "Latest". When that's a nightly (tag `<semver>+<datestamp>`), the CDN mirror (`gha.elide.zip/cli/v1/snapshot/<os>-<arch>/<tag>/`) has no matching object and the download 404s. Resolve the per-platform asset (`elide.<os>-<arch>.<ext>`) from the release's attached assets and download that directly; fall back to the CDN URL when a release carries no matching asset. Asset labels use `macos`/`arm64`, mapped from the action's `darwin`/`aarch64` internals. This makes `version: latest` track each new nightly as it's published. Signed-off-by: Sam Gammon <sam@elide.dev>
GitHub release assets unpack as a full distribution with the binary at bin/elide; the CDN snapshot layout had it at the root. Probe both after unpack/cache-restore and point PATH at the dir that actually holds the binary - which also exposes the bundled toolchain (javac, kotlinc) for release assets. Fixes "Unable to locate executable" during prewarm when version: latest resolves a nightly. Signed-off-by: Sam Gammon <sam@elide.dev>
`elide run -c <code>` is not supported on newer Elide versions (1.2.x rejects the inline-code flag), so prewarm now writes a temp script and runs `elide run <file>`, which is stable across versions. Prewarming is an optimization: failures (nonzero exit or spawn errors) log a warning and never fail the action. Signed-off-by: Sam Gammon <sam@elide.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The action emitted
Elide version mismatch: expected '…', but got '…'whenever the resolved release tag and the binary's self-reported--versiondiffered as strings — including harmless format differences. A release tagged1.2.0+20260430ships a binary that reports1.2.0, so the build-metadata suffix (and any leadingv) tripped the warning even though the versions are identical.Change
normalizeVersion()(trim, drop leadingv, strip+buildmetadata) andversionsMatch()incommand.ts.versionsMatch()for both the post-download mismatch warning and the existing-binary preserve check inmain.ts.A genuine version difference (e.g.
1.1.0vs1.2.0) still warns; only format-only differences are now tolerated.Notes
dist/bundle rebuilt viancc(the action runsdist/index.js).tsc --noEmitclean;command.tsat 100% coverage. The pre-existing network-download tests inmain.test.tsare unaffected by this change.